import http from './index'

export default {
  // 获取所有
  getLoadInformation() {
    return new Promise((resolve, reject) => {
      http('get', '/load').then(
        (response) => {
          resolve(response)
        },
        (err) => {
          reject(err)
        }
      )
    })
  },
  // 通过
  postLoadInformation(id) {
    return new Promise((resolve, reject) => {
      http('post', `/load/pass?id=${id}`).then(
        (response) => {
          resolve(response)
        },
        (err) => {
          reject(err)
        }
      )
    })
  },
  // 忽略
  postIgnoreInformation(id) {
    return new Promise((resolve, reject) => {
      http('post', `/load/ignore?id=${id}`).then(
        (response) => {
          resolve(response)
        },
        (err) => {
          reject(err)
        }
      )
    })
  },
  // 搜索
  postSearchInformation(value) {
    return new Promise((resolve, reject) => {
      http('post', `/load/search?value=${value}`).then(
        (response) => {
          resolve(response)
        },
        (err) => {
          reject(err)
        }
      )
    })
  },
}
